Optimal. Leaf size=358 \[ -\frac {(a-i b)^2 (i A+B-i C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{(c-i d)^{5/2} f}-\frac {(a+i b)^2 (B-i (A-C)) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{(c+i d)^{5/2} f}-\frac {2 \left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{3 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}}+\frac {2 (b c-a d) \left (b \left (4 c^4 C-B c^3 d-2 c^2 (A-5 C) d^2-7 B c d^3+4 A d^4\right )+3 a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{3 d^3 \left (c^2+d^2\right )^2 f \sqrt {c+d \tan (e+f x)}}+\frac {2 b^2 \left (4 c^2 C-B c d+(A+3 C) d^2\right ) \sqrt {c+d \tan (e+f x)}}{3 d^3 \left (c^2+d^2\right ) f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 1.04, antiderivative size = 358, normalized size of antiderivative = 1.00, number of steps
used = 10, number of rules used = 7, integrand size = 47, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.149, Rules used = {3726, 3716,
3711, 3620, 3618, 65, 214} \begin {gather*} -\frac {2 \left (A d^2-B c d+c^2 C\right ) (a+b \tan (e+f x))^2}{3 d f \left (c^2+d^2\right ) (c+d \tan (e+f x))^{3/2}}+\frac {2 (b c-a d) \left (3 a d^2 \left (2 c d (A-C)-B \left (c^2-d^2\right )\right )+b \left (-2 c^2 d^2 (A-5 C)+4 A d^4-B c^3 d-7 B c d^3+4 c^4 C\right )\right )}{3 d^3 f \left (c^2+d^2\right )^2 \sqrt {c+d \tan (e+f x)}}-\frac {(a-i b)^2 (i A+B-i C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{f (c-i d)^{5/2}}-\frac {(a+i b)^2 (B-i (A-C)) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{f (c+i d)^{5/2}}+\frac {2 b^2 \left (d^2 (A+3 C)-B c d+4 c^2 C\right ) \sqrt {c+d \tan (e+f x)}}{3 d^3 f \left (c^2+d^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 65
Rule 214
Rule 3618
Rule 3620
Rule 3711
Rule 3716
Rule 3726
Rubi steps
\begin {align*} \int \frac {(a+b \tan (e+f x))^2 \left (A+B \tan (e+f x)+C \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^{5/2}} \, dx &=-\frac {2 \left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{3 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}}+\frac {2 \int \frac {(a+b \tan (e+f x)) \left (\frac {1}{2} \left (2 A d \left (\frac {3 a c}{2}+2 b d\right )+2 \left (2 b c-\frac {3 a d}{2}\right ) (c C-B d)\right )+\frac {3}{2} d ((A-C) (b c-a d)+B (a c+b d)) \tan (e+f x)+\frac {1}{2} b \left (4 c^2 C-B c d+(A+3 C) d^2\right ) \tan ^2(e+f x)\right )}{(c+d \tan (e+f x))^{3/2}} \, dx}{3 d \left (c^2+d^2\right )}\\ &=-\frac {2 \left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{3 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}}+\frac {2 (b c-a d) \left (b \left (4 c^4 C-B c^3 d-2 c^2 (A-5 C) d^2-7 B c d^3+4 A d^4\right )+3 a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{3 d^3 \left (c^2+d^2\right )^2 f \sqrt {c+d \tan (e+f x)}}+\frac {2 \int \frac {\frac {1}{2} \left (b^2 \left (4 c^4 C-B c^3 d-2 c^2 (A-5 C) d^2-7 B c d^3+4 A d^4\right )-3 a^2 d^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+6 a b d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )-\frac {3}{2} d^2 \left (2 a b \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \tan (e+f x)+\frac {1}{2} b^2 \left (c^2+d^2\right ) \left (4 c^2 C-B c d+(A+3 C) d^2\right ) \tan ^2(e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{3 d^2 \left (c^2+d^2\right )^2}\\ &=-\frac {2 \left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{3 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}}+\frac {2 (b c-a d) \left (b \left (4 c^4 C-B c^3 d-2 c^2 (A-5 C) d^2-7 B c d^3+4 A d^4\right )+3 a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{3 d^3 \left (c^2+d^2\right )^2 f \sqrt {c+d \tan (e+f x)}}+\frac {2 b^2 \left (4 c^2 C-B c d+(A+3 C) d^2\right ) \sqrt {c+d \tan (e+f x)}}{3 d^3 \left (c^2+d^2\right ) f}+\frac {2 \int \frac {-\frac {3}{2} d^2 \left (a^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-b^2 \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )-2 a b \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )-\frac {3}{2} d^2 \left (2 a b \left (c^2 C-2 B c d-C d^2-A \left (c^2-d^2\right )\right )+a^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )-b^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right ) \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{3 d^2 \left (c^2+d^2\right )^2}\\ &=-\frac {2 \left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{3 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}}+\frac {2 (b c-a d) \left (b \left (4 c^4 C-B c^3 d-2 c^2 (A-5 C) d^2-7 B c d^3+4 A d^4\right )+3 a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{3 d^3 \left (c^2+d^2\right )^2 f \sqrt {c+d \tan (e+f x)}}+\frac {2 b^2 \left (4 c^2 C-B c d+(A+3 C) d^2\right ) \sqrt {c+d \tan (e+f x)}}{3 d^3 \left (c^2+d^2\right ) f}+\frac {\left ((a-i b)^2 (A-i B-C)\right ) \int \frac {1+i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{2 (c-i d)^2}+\frac {\left ((a+i b)^2 (A+i B-C)\right ) \int \frac {1-i \tan (e+f x)}{\sqrt {c+d \tan (e+f x)}} \, dx}{2 (c+i d)^2}\\ &=-\frac {2 \left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{3 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}}+\frac {2 (b c-a d) \left (b \left (4 c^4 C-B c^3 d-2 c^2 (A-5 C) d^2-7 B c d^3+4 A d^4\right )+3 a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{3 d^3 \left (c^2+d^2\right )^2 f \sqrt {c+d \tan (e+f x)}}+\frac {2 b^2 \left (4 c^2 C-B c d+(A+3 C) d^2\right ) \sqrt {c+d \tan (e+f x)}}{3 d^3 \left (c^2+d^2\right ) f}+\frac {\left ((a-i b)^2 (i A+B-i C)\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c-i d x}} \, dx,x,i \tan (e+f x)\right )}{2 (c-i d)^2 f}-\frac {\left (i (a+i b)^2 (A+i B-C)\right ) \text {Subst}\left (\int \frac {1}{(-1+x) \sqrt {c+i d x}} \, dx,x,-i \tan (e+f x)\right )}{2 (c+i d)^2 f}\\ &=-\frac {2 \left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{3 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}}+\frac {2 (b c-a d) \left (b \left (4 c^4 C-B c^3 d-2 c^2 (A-5 C) d^2-7 B c d^3+4 A d^4\right )+3 a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{3 d^3 \left (c^2+d^2\right )^2 f \sqrt {c+d \tan (e+f x)}}+\frac {2 b^2 \left (4 c^2 C-B c d+(A+3 C) d^2\right ) \sqrt {c+d \tan (e+f x)}}{3 d^3 \left (c^2+d^2\right ) f}-\frac {\left ((a-i b)^2 (A-i B-C)\right ) \text {Subst}\left (\int \frac {1}{-1-\frac {i c}{d}+\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{(c-i d)^2 d f}-\frac {\left ((a+i b)^2 (A+i B-C)\right ) \text {Subst}\left (\int \frac {1}{-1+\frac {i c}{d}-\frac {i x^2}{d}} \, dx,x,\sqrt {c+d \tan (e+f x)}\right )}{(c+i d)^2 d f}\\ &=-\frac {(a-i b)^2 (i A+B-i C) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c-i d}}\right )}{(c-i d)^{5/2} f}-\frac {(a+i b)^2 (B-i (A-C)) \tanh ^{-1}\left (\frac {\sqrt {c+d \tan (e+f x)}}{\sqrt {c+i d}}\right )}{(c+i d)^{5/2} f}-\frac {2 \left (c^2 C-B c d+A d^2\right ) (a+b \tan (e+f x))^2}{3 d \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}}+\frac {2 (b c-a d) \left (b \left (4 c^4 C-B c^3 d-2 c^2 (A-5 C) d^2-7 B c d^3+4 A d^4\right )+3 a d^2 \left (2 c (A-C) d-B \left (c^2-d^2\right )\right )\right )}{3 d^3 \left (c^2+d^2\right )^2 f \sqrt {c+d \tan (e+f x)}}+\frac {2 b^2 \left (4 c^2 C-B c d+(A+3 C) d^2\right ) \sqrt {c+d \tan (e+f x)}}{3 d^3 \left (c^2+d^2\right ) f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 4.68, size = 414, normalized size = 1.16 \begin {gather*} -\frac {-2 (c-i d) (c+i d) \left (8 a^2 C d^2+a b d (-16 c C+B d)+b^2 \left (8 c^2 C-2 B c d+(-A+C) d^2\right )\right )-d^2 \left (-2 a b (A c-c C+B d)-a^2 (B c+(-A+C) d)+b^2 (B c+(-A+C) d)\right ) \left (i (c+i d) \, _2F_1\left (-\frac {3}{2},1;-\frac {1}{2};\frac {c+d \tan (e+f x)}{c-i d}\right )-(i c+d) \, _2F_1\left (-\frac {3}{2},1;-\frac {1}{2};\frac {c+d \tan (e+f x)}{c+i d}\right )\right )-6 (c-i d) (c+i d) d (4 b c C-b B d-4 a C d) (a+b \tan (e+f x))-6 C (c-i d) (c+i d) d^2 (a+b \tan (e+f x))^2-3 \left (a^2 B-b^2 B+2 a b (A-C)\right ) d^2 \left (i (c+i d) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};\frac {c+d \tan (e+f x)}{c-i d}\right )-(i c+d) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};\frac {c+d \tan (e+f x)}{c+i d}\right )\right ) (c+d \tan (e+f x))}{3 d^3 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Leaf count of result is larger than twice the leaf count of optimal. \(15608\) vs.
\(2(325)=650\).
time = 0.70, size = 15609, normalized size = 43.60
method | result | size |
derivativedivides | \(\text {Expression too large to display}\) | \(15609\) |
default | \(\text {Expression too large to display}\) | \(15609\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [F(-1)] Timed out
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Timed out} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\left (a + b \tan {\left (e + f x \right )}\right )^{2} \left (A + B \tan {\left (e + f x \right )} + C \tan ^{2}{\left (e + f x \right )}\right )}{\left (c + d \tan {\left (e + f x \right )}\right )^{\frac {5}{2}}}\, dx \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: TypeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 116.90, size = 2500, normalized size = 6.98 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________